package com.myspring.lab.control;

import com.myspring.lab.dao.DbProject;
import com.myspring.lab.entity.Project;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class DoMain {
    @RequestMapping("/main")
    public String domain(Model model){
        DbProject dbProject = new DbProject();
        Project[] projects = dbProject.getAllProject();
        model.addAttribute("Projects",projects);
        return "main";
    }
    @RequestMapping("/edit")
    public String doedit(Model model){
        DbProject dbProject = new DbProject();
        Project[] projects = dbProject.getAllProject();
        model.addAttribute("Projects",projects);
        return "edit";
    }
}
